module app.model.Article;

import hunt.entity;
import hunt.validation;

@Table("article")
class Article : Model
{
    mixin MakeModel;

    @AutoIncrement @PrimaryKey ulong id;

    @Length(1, 1024, "标题长度必须在 {{min}} and {{max}} 之间")
    string title;

    long cid;

    string desc;

    @NotBlank("文章内容不能为空")
    string content;

    string img;

    @Column("comment_count")
    int commentCount;

    @Column("view_count")
    ulong viewCount;

    @Column("created_at")
    ulong createdAt;

    @Column("updated_at")
    ulong updatedAt;

    @Column("isdelete")
    bool isdelete;

    bool istop;
}
